package com.maixy.studyonlineapi.result;


import com.google.common.collect.Lists;
import com.maixy.studyonlineapi.bean.Page;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageData<T> implements Serializable {

    private static final long serialVersionUID = 4221794668065354694L;
    private List<T> data;

    private Page page;

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public PageData<?> empty() {
        this.setData(Lists.newArrayList());
        this.setPage(new Page(1, 10, false));
        return this;
    }
}
